<template>
  <div>
    <van-nav-bar title="支付"
                 left-text="返回"
                 left-arrow>
    </van-nav-bar>
    <div class="pay_info">
      <img :src="payInfo.code_url">
      <div>订单号：{{payInfo.order_no}}</div>
      <div>订单金额:￥{{payInfo.total_fee}}</div>
      <div>实付金额:￥{{payInfo.real_fee}}</div>
    </div>
  </div>
</template>
<script>
import { wxpayApi } from '../../api/pay'
export default {

  data () {
    return {
      pay_sn: "",
      payInfo: {}
    }
  },
  created () {
    this.pay_sn = this.$route.params.pay_sn;
    console.log(this.$route.params.pay_sn)
    console.log(this.pay_sn)
    wxpayApi(this.pay_sn).then(res => {
      console.log(res)
      this.payInfo = res.data;
    })
  }
}
</script>
<style lang="less">
.pay_info {
  padding: 0 30px;
  box-sizing: border-box;
  text-align: center;
  img {
    margin: 20px auto;
  }
  div {
    text-align: left;
  }
  font-size: 30px;
  line-height: 180px;
}
</style>